<?php
/**
 * Date: 27.05.14
 */
class CartFunctions
{
    public function getCartArray(){
        return json_decode(Yii::app()->request->cookies['cart'], true);
    }

    public function setCartArray($array){
        Yii::app()->request->cookies['cart'] = new CHttpCookie('cart', json_encode($array));
    }
    
    public function emptyCart(){
        $cart_array = array();
        CartFunctions::setCartArray($cart_array);
    }
}
